﻿<div>

    <script type="text/javascript">
        $(function () {
            var btn = $("#lbtn1");

            $("#Button1").click(function () {
                btn.linkbutton("setIcon", "icon-hamburg-busy");
            });

            $("#Button2").click(function () {
                btn.linkbutton("setIcon", null);
            });

            $("#Button3").click(function () {
                btn.linkbutton("setText", "自定义按钮1");
            });

            $("#Button4").click(function () {
                btn.linkbutton("setText", null);
            });

            $("#Button5").click(function () {
                btn.linkbutton("setIconAlign", "left");
            });

            $("#Button6").click(function () {
                btn.linkbutton("setIconAlign", "right");
            });

            $("#Button7").click(function () {
                btn.linkbutton("setPlain", true);
            });

            $("#Button8").click(function () {
                btn.linkbutton("setPlain", false);
            });

            $("#Button9").click(function () {
                btn.linkbutton("setStyle", {
                    backgroundColor: "Red",
                    color: "Blue"
                });
            });


            var i = 1;
            $("#lbtn2").click(function () {
                $("<br /><br />").appendTo("#cc");
                $("<a></a>").appendTo("#cc").linkbutton({ text: "测试按钮" + i++, iconCls: "icon-standard-anchor" }).click(function () {
                    alert("my name is: " + $(this).linkbutton("options").text);
                });
            });
        });
    </script>

    <h2>jEasyUI LinkButton Extensions</h2>
    <p>该部分扩展由文件 jeasyui.extensions.linkbutton.js 实现。</p>
    <hr />
    <input id="Button1" type="button" value="设置图标" style="background" />
    <input id="Button2" type="button" value="清除图标" />

    <input id="Button3" type="button" value="设置文字" />
    <input id="Button4" type="button" value="清除文字" />
    <br /><br />
    <input id="Button5" type="button" value="设置图标位置-左" />
    <input id="Button6" type="button" value="设置图标位置-右" />

    <input id="Button7" type="button" value="设置Plain-true" />
    <input id="Button8" type="button" value="设置Plain-false" />
    <br /><br />
    <input id="Button9" type="button" value="添加自定义样式" />
    <hr />
    <a id="lbtn1" class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-config', iconAlign: 'left'">按钮1</a>
    <hr />
    <a id="lbtn2" class="easyui-linkbutton" data-options="plain: false, iconCls: 'icon-add', iconAlign: 'left'">在下面的容器中增加一个 easyui-linkbutton</a>
    <hr />
    <div id="cc" style="border-width: 1px; border-style: solid; border-color: Black; width: 400px; height: 200px; padding: 10px; overflow: auto;">
        linkbutton 容器
    </div>

</div>